<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>

<%

    String employeeName = request.getParameter("empname");
    String employeeDesignation = request.getParameter("empdesg");
    String employeePassword = request.getParameter("emppass");

    if (employeeDesignation != null && employeeName != null && employeePassword != null) {
        Connection con;

        Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/clases", "root", "kiko2897");
        
        PreparedStatement statement = con.prepareStatement("insert into employee(empname,empdesg,emppass) values(?,?,?)");
        statement.setString(1, employeeName);
        statement.setString(2, employeeDesignation);
        statement.setString(3, employeePassword);
        
        statement.execute();
        
    }
    
    response.sendRedirect(request.getContextPath()+"/SSL/welcome.jsp");
%>